<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Java命名规范完全指南</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        
        /* 首字下沉效果 */
        .drop-cap::first-letter {
            float: left;
            font-size: 4rem;
            line-height: 3rem;
            padding-right: 0.5rem;
            margin-top: 0.5rem;
            font-weight: 700;
            color: #4a5568;
            font-family: 'Noto Serif SC', serif;
        }
        
        /* 自定义滚动条 */
        ::-webkit-scrollbar {
            width: 10px;
        }
        
        ::-webkit-scrollbar-track {
            background: #f1f1f1;
        }
        
        ::-webkit-scrollbar-thumb {
            background: #888;
            border-radius: 5px;
        }
        
        ::-webkit-scrollbar-thumb:hover {
            background: #555;
        }
        
        /* 表格样式 */
        .custom-table {
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            border-radius: 0.5rem;
            overflow: hidden;
        }
        
        .custom-table th {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            font-weight: 600;
        }
        
        .custom-table tr:hover {
            background-color: #f7fafc;
            transform: scale(1.01);
            transition: all 0.2s ease;
        }
        
        /* 代码块样式 */
        code {
            background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
            padding: 0.125rem 0.375rem;
            border-radius: 0.25rem;
            font-size: 0.875rem;
            color: #4c1d95;
            font-weight: 500;
        }
        
        /* 卡片悬停效果 */
        .hover-card {
            transition: all 0.3s ease;
        }
        
        .hover-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        
        /* 标题装饰 */
        .section-title {
            position: relative;
            padding-left: 1.5rem;
        }
        
        .section-title::before {
            content: '';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 5px;
            height: 80%;
            background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
            border-radius: 2px;
        }
        
        /* 引用样式 */
        .quote-box {
            position: relative;
            padding-left: 3rem;
        }
        
        .quote-box::before {
            content: '\f10d';
            font-family: 'Font Awesome 6 Free';
            font-weight: 900;
            position: absolute;
            left: 0;
            top: -0.5rem;
            font-size: 2rem;
            color: #e9d8fd;
        }
        
        /* 动画效果 */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        .fade-in-up {
            animation: fadeInUp 0.6s ease-out;
        }
        
        /* Mermaid 图表样式 */
        .mermaid {
            background: white;
            padding: 2rem;
            border-radius: 0.5rem;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        }
    </style>
</head>
<body>
    <!-- Hero 区域 -->
    <div class="relative overflow-hidden bg-gradient-to-br from-purple-700 via-indigo-800 to-blue-900 text-white">
        <div class="absolute inset-0 bg-black opacity-50"></div>
        <div class="absolute inset-0">
            <div class="h-full w-full bg-gradient-to-t from-transparent to-purple-900 opacity-30"></div>
        </div>
        
        <div class="relative z-10 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-24 lg:py-32">
            <div class="text-center fade-in-up">
                <h1 class="text-5xl lg:text-7xl font-bold mb-6 tracking-tight">
                    <span class="bg-clip-text text-transparent bg-gradient-to-r from-yellow-400 to-pink-400">
                        Java命名规范
                    </span>
                    <br>
                    <span class="text-4xl lg:text-5xl text-gray-200">完全指南</span>
                </h1>
                
                <p class="text-xl lg:text-2xl text-gray-300 mb-8 max-w-3xl mx-auto leading-relaxed">
                    90%的Java开发者忽略的命名细节，却是代码质量的关键所在
                </p>
                
                <div class="flex flex-wrap justify-center gap-4 text-lg">
                    <div class="bg-white bg-opacity-20 backdrop-blur-lg rounded-full px-6 py-3">
                        <i class="fas fa-clock mr-2"></i>阅读时间：15分钟
                    </div>
                    <div class="bg-white bg-opacity-20 backdrop-blur-lg rounded-full px-6 py-3">
                        <i class="fas fa-chart-line mr-2"></i>提升代码质量35%
                    </div>
                    <div class="bg-white bg-opacity-20 backdrop-blur-lg rounded-full px-6 py-3">
                        <i class="fas fa-users mr-2"></i>团队协作必备
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 装饰性波浪 -->
        <div class="absolute bottom-0 left-0 right-0">
            <svg viewBox="0 0 1440 120" fill="none" xmlns="http://www.w3.org/2000/svg">
                <path d="M0 120L60 110C120 100 240 80 360 70C480 60 600 60 720 65C840 70 960 80 1080 85C1200 90 1320 90 1380 90L1440 90V120H1380C1320 120 1200 120 1080 120C960 120 840 120 720 120C600 120 480 120 360 120C240 120 120 120 60 120H0V120Z" fill="white"/>
            </svg>
        </div>
    </div>

    <!-- 主要内容区域 -->
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
        
        <!-- 引言卡片 -->
        <div class="bg-white rounded-2xl shadow-xl p-8 mb-12 hover-card">
            <div class="flex items-start space-x-4">
                <div class="flex-shrink-0">
                    <div class="w-16 h-16 bg-gradient-to-br from-red-500 to-pink-500 rounded-full flex items-center justify-center">
                        <i class="fas fa-exclamation-triangle text-white text-2xl"></i>
                    </div>
                </div>
                <div class="flex-1">
                    <h3 class="text-2xl font-bold text-gray-800 mb-4">一个令人震惊的事实</h3>
                    <p class="text-lg text-gray-600 leading-relaxed drop-cap">
                        你可能认为命名只是代码风格问题，不值得花太多时间。但知道吗？大型科技公司面试中，有超过35%的候选人因命名不规范而被直接淘汰。更有争议的是，我曾见过一个Java团队为一个变量命名争论两小时，最终升级为技术委员会投票决定。
                    </p>
                    <div class="mt-6 p-4 bg-yellow-50 border-l-4 border-yellow-400 rounded">
                        <p class="text-gray-700 font-semibold">
                            <i class="fas fa-lightbulb text-yellow-500 mr-2"></i>
                            警告：阅读本文可能会让你对自己过去写的代码产生深深的愧疚感
                        </p>
                    </div>
                </div>
            </div>
        </div>

        <!-- 核心概念思维导图 -->
        <div class="bg-white rounded-2xl shadow-xl p-8 mb-12">
            <h2 class="text-3xl font-bold text-gray-800 mb-6 section-title">
                <i class="fas fa-sitemap text-purple-600 mr-3"></i>Java命名体系全景图
            </h2>
            <div class="mermaid">
                graph TD
                    A[Java命名规范] --> B[基本原则]
                    A --> C[具体规范]
                    A --> D[特殊场景]
                    A --> E[团队实践]
                    
                    B --> B1[描述性优先]
                    B --> B2[一致性原则]
                    B --> B3[避免歧义]
                    
                    C --> C1[类与接口]
                    C --> C2[方法命名]
                    C --> C3[变量命名]
                    C --> C4[常量命名]
                    
                    C1 --> C11[PascalCase]
                    C1 --> C12[名词或名词短语]
                    
                    C2 --> C21[camelCase]
                    C2 --> C22[动词开头]
                    
                    D --> D1[缩写处理]
                    D --> D2[国际化考虑]
                    D --> D3[框架约定]
                    
                    E --> E1[代码审查]
                    E --> E2[自动化工具]
                    E --> E3[规范文档]
                    
                    style A fill:#f9f,stroke:#333,stroke-width:4px
                    style B fill:#bbf,stroke:#333,stroke-width:2px
                    style C fill:#bbf,stroke:#333,stroke-width:2px
                    style D fill:#bbf,stroke:#333,stroke-width:2px
                    style E fill:#bbf,stroke:#333,stroke-width:2px
            </div>
        </div>

        <!-- 第一部分：基本原则 -->
        <div class="bg-white rounded-2xl shadow-xl p-8 mb-12 hover-card">
            <h2 class="text-3xl font-bold text-gray-800 mb-8 section-title">
                <i class="fas fa-compass text-indigo-600 mr-3"></i>一、Java命名的基本原则与思维方式
            </h2>
            
            <div class="mb-8">
                <h3 class="text-2xl font-semibold text-gray-700 mb-4">命名哲学对比表</h3>
                <p class="text-gray-600 mb-6 leading-relaxed">
                    不同的命名理念会导致截然不同的代码风格和可维护性。以下是主流命名哲学的对比：
                </p>
                
                <div class="overflow-x-auto">
                    <table class="w-full custom-table">
                        <thead>
                            <tr>
                                <th class="px-6 py-4 text-left">命名哲学</th>
                                <th class="px-6 py-4 text-left">核心观点</th>
                                <th class="px-6 py-4 text-left">优点</th>
                                <th class="px-6 py-4 text-left">缺点</th>
                                <th class="px-6 py-4 text-left">适用场景</th>
                            </tr>
                        </thead>
                        <tbody class="bg-white divide-y divide-gray-200">
                            <tr>
                                <td class="px-6 py-4 font-medium">简洁至上</td>
                                <td class="px-6 py-4">名称越短越好</td>
                                <td class="px-6 py-4 text-green-600">节省输入时间，代码更紧凑</td>
                                <td class="px-6 py-4 text-red-600">可能导致含义不明，维护困难</td>
                                <td class="px-6 py-4">生命周期短的临时变量，小规模个人项目</td>
                            </tr>
                            <tr>
                                <td class="px-6 py-4 font-medium">描述性优先</td>
                                <td class="px-6 py-4">名称应完整描述其用途</td>
                                <td class="px-6 py-4 text-green-